subroutine vvvv_half(t2, fact)
use mod_ioff
use mod_orbit
use mod_iop 
use mod_symm
use mod_size
implicit none
real*8, intent(inout) :: fact
real*8, intent(inout) :: t2(*)
!
integer i, j, a, b, irrepi, irrepj, irrepa, irrepb
integer irrepai, irrepbj, irrepaj, irrepbi
integer idxai, idxbj, idxaj, idxbi 
integer iai, ibj, iaj, ibi
integer numa, numb, numi, numj, iofft2(8) 
integer irrepab, irrepij, numab, numij, na
integer ioffoa(8), ioffva(8) 
integer ioffob(8), ioffvb(8), ij 
integer idxa, idxb, idxi, idxj, idx, iofft, nsize 
integer zorb2(8)
integer, external :: irpdso, isymoffso, idsymsoc
real*8 dtmp
!
zorb2(1:8) = 1
!
!---------------for ABAB 
iofft2(1) = 1
do irrepij = 1, nirrep - 1
   irrepab = dirprd(irrepij, 1)
   numij = irpdso(irrepij, vrta, vrta, 1)
   numab = irpdso(irrepab, vrta, vrta, 1)
   iofft2(irrepij+1) = iofft2(irrepij) + numab*numij
enddo
!
do irrepij = 1, nirrep
   irrepab = dirprd(irrepij, 1)
   numab = irpdso(irrepab, vrta, vrta, 1)
   numij = irpdso(irrepij, vrta, vrta, 1)
   do irrepb = 1, nirrep
      irrepa = dirprd(irrepb, irrepab)
      if(irrepb/=irrepa) cycle
      if(irrepb==irrepa) then 
      numa = vrta(irrepa)
      numb = vrta(irrepb)
      iofft = iofft2(irrepij)-1 &
           +  isymoffso(irrepb,irrepab,vrta,vrta,1)-1
            do ij = 1, numij
            do b = 1, numb
               idx = iofft + (ij-1)*numab &
                          +  (b-1)*numb + b
               t2(idx) = t2(idx)*fact
            enddo
            enddo
        endif
   enddo
enddo


return
end
